package com.yanqu.road.server.cmd.banquet;

import com.yanqu.road.entity.banquet.UserBanquetRelationship;
import com.yanqu.road.pb.banquet.BanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.banquet.BanquetModule;
import com.yanqu.road.server.pb.BanquetPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;


//@Cmd(code = Protocol.S_BANQUET_RELATIONSHIP_GET, desc = "请求宴会互宴信息列表")
public class GetBanquetRelationshipCmd extends AbstractCommand {

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

	}

	@Override
	public void sendData(GamePlayer player) {
		List<UserBanquetRelationship> dataList = player.getModule(BanquetModule.class).getUserBanquetRelationship();
		BanquetProto.BanquetRelationshipRespMsg.Builder respMsg = BanquetPb.parseBanquetRelationshipRespMsg(dataList);
		player.sendPacket(Protocol.U_BANQUET_RELATIONSHIP_GET, respMsg);
	}
}
